﻿namespace _4InARowUI
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Drawing;
    using System.Windows.Forms;
    using _4InARow;

    public class TableForm : Form
    {
        public const uint k_PlayerNumber1 = 1;
        public const uint k_PlayerNumber2 = 2;

        private Board m_Board;
        private Player m_Player1;
        private Player m_Player2;
        private Player m_CurrentPlayer;
        uint m_Width, m_Height;

        public TableForm()
        {
            m_Player1 = new Player(Player.ePlayerType.Human, k_PlayerNumber1);
            m_CurrentPlayer = m_Player1;
        }

        public void InitTableSizes(uint i_Width, uint i_Hight)
        {
            m_Width = i_Width;
            m_Height = i_Hight;
        }

        private void printBoard()
        {
            for (uint i = 1; i <= m_Width; i++)
            {
                Button newButton =  new Button();
                newButton.Text = i.ToString();
                this.Controls.Add(newButton);
            }

            for (uint i = 0; i < m_Height; i++)
            {
                for (uint j = 0; j < m_Width; j++)
                {
                    //~~~~~~STOPPED HERE~~~~~//
                    boardScreen.Append(string.Format("| {0} ", i_Board.GetCharBySquare(j + 1, i + 1)));
                }

                boardScreen.Append('|');
                boardScreen.AppendLine();
                string separatorsLine = new string('=', ((int)i_Board.Width * 4) + 1);
                boardScreen.AppendLine(separatorsLine);
            }

            Console.WriteLine(boardScreen);
        }
    }
}